-- FETCH_GEAR_SHOP_GOODS

-- 齿轮商店
-- @param user 玩家对象
return function(user)

    local goods = DungeonShopM.getGoodsByType("gear_shop_1");
    local ret = {};

    -- 固定出现的
    for _, data in ipairs(goods) do
        table.insert(ret, { ["goodsId"] = data["id"], });
    end

    -- 随机出现的
    goods = DungeonShopM.getGoodsByType("gear_shop");

    local sum = 0;
    local rand;

    for _, data in ipairs(goods) do
        sum = sum + data["ratio"];
    end

    rand = DungeonM.getRandSeed("shop") % sum;
    sum = 0;

    for _, data in ipairs(goods) do
        sum = sum + data["ratio"];

        if rand < sum then
            table.insert(ret, {["goodsId"] = data["id"], });
            break;
        end
    end

    return ret;
end
